<?php
/**
 * Created by PhpStorm.
 * User: MCAT
 * Date: 2018/11/7
 * Time: 9:36
 */

namespace app\api\controller;


use think\Controller;

class StoneflyBase extends Controller
{
    public function SpliceSrc($img){//补全路径['数据库中未全地址，图片所属信息类']
        $domainName= $_SERVER['SERVER_ADDR'];//主机IP地址
        $imgSrc = '';
        if ($img==null||$img=='nopic'||$img=='') {
            $imgSrc = null;
        }else{
            $imgSrc = 'http://'.$domainName.'/ren/public/static/images/'.$img;//拼接图片完整路径
        }
        return $imgSrc;//返回全路径

    }

}